'use client';
import Header from './Header';
import Footer from './Footer';
import { usePathname } from 'next/navigation';

export default function ClientLayout({ children }) {
  const pathname = usePathname();
  const noLayoutPaths = ['/login', '/register'];
  const isNotFoundPage = pathname.includes('not-found');
  const mainClassName =
    noLayoutPaths.includes(pathname) || isNotFoundPage ? '' : 'pt-[60px]';

  if (noLayoutPaths.includes(pathname) || isNotFoundPage) {
    return <main>{children}</main>;
  }

  return (
    <>
      <Header />
      <main className={mainClassName}>{children}</main>
      <Footer />
    </>
  );
}
